package com.coolbi.security.biz.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.coolbi.security.biz.RolesBiz;
import com.coolbi.security.dao.RolesDao;
import com.coolbi.security.entity.Roles;

public class RolesBizImpl implements RolesBiz {
	
	@Autowired 
	private RolesDao rolesDao;
	public void setRolesDao(RolesDao rolesDao) {
		this.rolesDao = rolesDao;
	}

	@Override
	public List<Roles> find(Map<String, Object> parameter) {
		return rolesDao.find(parameter);
	}

	@Override
	public List<Roles> find(Map<String, Object> parameter, int offset,
			int limit) {
		return rolesDao.find(parameter,offset,limit);
	}

	@Override
	public int count(Map<String, Object> parameter) {
		return rolesDao.count();
	}

	@Override
	public int countByKeyword(String keyword) {
		return rolesDao.countByKeyword(keyword);
	}

	@Override
	public List<Roles> search(String keyword, int offset, int limit) {
		return rolesDao.search(keyword, offset, limit);
	}

	@Override
	public Roles save(Roles obj) {
		return rolesDao.save(obj);
	}

	@Override
	public int update(Roles obj) {
		return rolesDao.update(obj);
	}

	@Override
	public int delete(long id) {
		return rolesDao.delete(id);
	}

	@Override
	public Roles get(long id) {
		return rolesDao.get(id);
	}

	@Override
	public List<Roles> list() {
		return rolesDao.list();
	}

	@Override
	public List<Roles> list(int offset, int limit) {
		return rolesDao.list(offset, limit);
	}

	@Override
	public int count() {
		return rolesDao.count();
	}

	@Override
	public boolean checkRoleName(String name) {
		return rolesDao.countByName(name) > 0;
	}

	@Override
	public boolean checkAuthority(String authority) {
		return rolesDao.countByAuthority(authority) > 0;
	}
}
